QT       += core gui x11extras network multimedia xml dbus qml

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets


TARGET = TranslateStar
TEMPLATE = app

# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

CONFIG += c++11

# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

PLATFORM = Deepin # Linux, Windows, Mac, Deepin

INCLUDEPATH += src
INCLUDEPATH += src/qapp-auto-config

HEADERS += \
    src/FloatButton.h \
    src/global.h \
    src/ShortCut.h \
    src/platform/IMonitor.h \
    src/platform/common.h \
    src/SystemTrayIcon.h \
    src/ConfigData.h \
    src/ConfigEditor.h \
    src/translator/BaiduTranslate.h \
    src/translator/BaiduOCR.h \
    src/translator/BaiduHanDict.h

SOURCES += \
    src/FloatButton.cpp \
    src/main.cpp \
    src/global.cpp \
    src/ShortCut.cpp \
    src/platform/IMonitor.cpp \
    src/SystemTrayIcon.cpp \
    src/ConfigData.cpp \
    src/ConfigEditor.cpp \
    src/translator/BaiduTranslate.cpp \
    src/translator/BaiduOCR.cpp \
    src/translator/BaiduHanDict.cpp

HEADERS += $$system(find src/qapp-auto-config/ -name "*.h")
SOURCES += $$system(find src/qapp-auto-config/ -name "*.cpp")

HEADERS += $$system(find src/display/ -name "*.h")
SOURCES += $$system(find src/display/ -name "*.cpp")

equals(PLATFORM, "Linux") {

    CONFIG += x11
    PKGCONFIG += xcb xcb-util
    LIBS += -lX11 -lXext -lXtst

    HEADERS += \
    src/platform/X11Picker.h \
    src/platform/X11Monitor.h

    SOURCES += \
    src/platform/X11Monitor.cpp \
    src/platform/X11Picker.cpp \
    src/platform/common_x11.cpp \
    src/platform/common_x11_key.cpp \
    src/platform/common_linux.cpp
}

equals(PLATFORM, "Deepin") {

    CONFIG += x11
    PKGCONFIG += xcb xcb-util
    LIBS += -lX11 -lXext -lXtst

    HEADERS += \
    src/platform/DeepinMonitor.h \
    src/platform/X11Picker.h

    SOURCES += \
    src/platform/DeepinMonitor.cpp \
    src/platform/X11Picker.cpp \
    src/platform/common_deepin.cpp \
    src/platform/common_linux.cpp \
    src/platform/common_x11_key.cpp
}


# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

RESOURCES += pics.qrc
